﻿using DDD.Grpc.Protos.Common.Enum;
using DDD.Grpc.Protos.Message.User;
using Grpc.Core;

namespace DDD.Grpc.Server.Services
{
    public class UserService : Main.UserService.UserServiceBase
    {
        private readonly ILogger<UserService> _logger;

        public UserService(ILogger<UserService> logger)
        {
            _logger = logger;
        }

        public override async Task<GetUserByIdResponse> GetUserById(GetUserByIdRequest request, ServerCallContext context)
        {
            return await Task.FromResult<GetUserByIdResponse>(new GetUserByIdResponse()
            {
                Id = request.Id,
                Address = new Protos.Common.ValueObject.Address()
                {
                    City = "中国",
                    Country = "中国",
                    Street = "街道"
                },
                Email = "123@qq.com",
                Phone = "1513525",
                Sex = SexEnum.Man
            });
        }
    }
}
